import {useAxios} from '@/hooks/web/useAxios'
import type {queryDept, addDeptType} from './types'

const request = useAxios()

//获取科室列表
export const listDept = (params?: queryDept) => {
    return request.get({
        url: '/system/dept/list',
        params
    })
}

//新增科室
export const addDept = (data: addDeptType) => {
    return request.post({
        url: '/system/dept',
        data
    })
}

// 修改科室
export const updateDept = (data: addDeptType) => {
    return request.put({
        url: '/system/dept',
        data
    })
}

//删除科室
export const delDept = (deptId: number) => {
    return request.delete({
        url: '/system/dept/' + deptId
    })
}

//根据部门编号获取详细信息
export const getDept = (deptId: number) => {
    return request.get({
        url: '/system/dept/' + deptId
    })
}
